<head>

</head>
<table border="1">
    <tr>
        <td>DOCENTE</td>
        <td>PUBLICACION</td>
        <td>FECHA PUBLICACION</td>
        <td>DESCRIPCION</td>
    </tr>
    <?php
include("conectar.php");
    $link = Conectarse();
    if (!$link) {
        die("Error in connection: " . pg_last_error());
    }
    $sql = "select * from v_publicacionDocente;";
    $resConsulta = pg_exec($link, $sql);
    if (!$resConsulta) {
        die("Error in SQL query:" . pg_last_error());
    }
    while ($row = pg_fetch_array($resConsulta)) {
        echo "<tr>
                <td>$row[0]</td>
                <td>$row[1]</td>
                <td>$row[2]</td>
                <td>$row[3]</td>       
            </tr>";
    }
    //Liberamos la memoria
    pg_free_result($resConsulta);
    //desconectamos la base de datos
    ?>
</table>